<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1">
    <meta content=always name=referrer>
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/style.css">
    <script src="__STATIC__/js/jquery-1.8.2.js"></script>
    <title>订单搜索</title>
    <script>
        $(function(){
            $(".wrap-order .num img").click(
                    function(){
                        $(".wrap-order .search ul").toggle();
                    }
            )
            $(".search ul li").click(
                    function(){
                        var a=$(".search ul li").index(this);
                        $(this).addClass("cur");
                        $(this).siblings().removeClass("cur");
                    }
            )
        })
    </script>
</head>
<body>
<div class="wrap-order">
    <div class="header">
        <p>订单搜索</p>
        <img src="__STATIC__/img/back.png" class="back" onclick =window.location.href="{:url('mobile/shop_auth/orderManage')}";>
    </div>
    <div class="search">
        <input type="search" placeholder="输入商品名称"><label><a href="javascript:putData();">搜索</a></label>
        <p class="num"><span id="search" style="margin-right: 5px;">订单号 </span><img src="__STATIC__/img/down.png"></p>
        <ul style="display: none;" id="UL">
            <input type="hidden" id="result" value="1" />
            <li class="cur"><a href="javascript:change(1);" id="order_id">订单号</a></li>
            <li><a href="javascript:change(2);" id="title_id">商品标题</a></li>
        </ul>
    </div>
</div>
<script>
    function change(id){
        if (id == 1){
            $('#search').text('订单号');
            $('#result').val(1);
            $('#UL').css('display','none');
        }else{
            $('#result').val(2);
            $('#search').text('商品标题');
            $('#UL').css('display','none');
        }
    }
    function putData(){
        var type = $('#result').val();
        var content = $("[type='search']").val();
        window.location.href = "{:url('mobile/shop_auth/orderManage')}?type=-1&search="+content+"&search_type="+type;
    }
</script>
</body>
</html>